package com.siren.tank.fire;

import com.siren.tank.group.AbstractFactory;
import com.siren.tank.group.BaseTank;
import com.siren.tank.group.Bullet;

/**
 * @author : wangjichao
 * @description:
 * @date : 2020/7/28 21:59
 */
public class SingleFire implements FireStrategy {
    @Override
    public void fire(BaseTank t) {
        int bx = t.getX() + BaseTank.WIDTH/2 - Bullet.WIDTH/2;
        int by = t.getY() + BaseTank.HEIGHT/2 - Bullet.HEIGHT/2;
        AbstractFactory.INSTANCE.createBullet(bx, by, t.getDir(), t.getGroup());
    }
}
